<!DOCTYPE html>
<html>
<head>
<title>{$site_name}</title>
<meta name="keywords" content="{$site_seo_keywords}" />
<meta name="description" content="{$site_seo_description}">
<meta name="author" content="ThinkCMF">
<tc_include file="Public:head" />
</head>

<body class="body-white">
	<tc_include file="Public:nav" />

	<div class="container tc-main">
		<div class="row">
			<div class="span4 offset4">
				<h2 class="text-center">忘记密码</h2>
				<form class="form-horizontal js-ajax-form" action="{:U('user/index/find_password_by_email')}" method="post">
					<div class="control-group">
						<input type="email" id="input_email" name="email" class="span4" placeholder="注册邮箱">
					</div>

					<div class="control-group">
						<div class="span4" style="margin-left: 0px">
							<input type="text" id="input_verify" name="auth_code" placeholder="验证码">
							<input type="button" id="send_auth_code" value="发送邮箱验证码" style="margin-left: 30px;">
						</div>
					</div>

					<div class="control-group">
						<input type="text" name="password" class="span4" placeholder="新密码">
					</div>

					<div class="control-group">
						<input type="text" name="repassword" class="span4" placeholder="确认密码">
					</div>

					<div class="control-group">
						<button class="btn btn-primary js-ajax-submit span4" type="submit" style="margin-left: 0px;">确定</button>
					</div>

					<div class="control-group" style="text-align: center;">
						<ul class="inline">
							<li><a href="{:leuu('user/register/index')}">现在注册</a></li>
							<li><a href="{:leuu('user/login/index')}">现在登录</a></li>
						</ul>
					</div>
				</form>
			</div>
		</div>

		 

	</div>
	<!-- /container -->
    <tc_include file="Public:footer" />
	<tc_include file="Public:scripts" />

	<script>
		$(function () {
			$('#send_auth_code').click(function () {
			    email = $('#input_email').val();
			    if (email) {
                    layer.msg('发送中', {
                        icon: 16,
						shade: 0.01
                    });
			        $.post("{:leuu('user/index/send_forget_pwd_key')}", {email : email}, function (re) {
                        layer.closeAll('loading');
						if (re.status) {
                            layer.msg('已发送，请前往 [邮箱/垃圾箱] 查看', {icon: 1});
						} else {
                            layer.msg(re.info, {icon: 2});
						}
                    })
				} else {
                    layer.msg('请输入正确的邮箱');
				}
            })
        })
	</script>
</body>
</html>